package com.book.Dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.jdbc.tool.DBLianjie;

public class SelectAllBook {
      public ResultSet findbook(){
    	  Connection conn=null;
    	  Statement stm=null;
    	  ResultSet rs=null;
    	  String sql="select * from book order by bookid";
    	  conn=DBLianjie.getconn();
    	  try {
			stm=conn.createStatement();
			rs=stm.executeQuery(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}

    	  return rs;
      }
      public ResultSet findbook(String fenlei){
    	  Connection conn=null;
    	  Statement stm=null;
    	  ResultSet rs=null;
    	  String sql="select * from book where FENLEIID="+fenlei+" order by bookid";
    	  conn=DBLianjie.getconn();
    	  try {
			stm=conn.createStatement();
			rs=stm.executeQuery(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}

    	  return rs;
      }
}
